package com.brillilab.domain.enums.account;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 积分状态:0未领取，1已领取，2已兑换
 * @author lj
 *
 */
@Getter
@AllArgsConstructor
public enum IntegralStateEnum {
	UNRECEIVED("未领取",0),RECEIVED("已领取",1),EXCHANGE("已兑换",2),INVALID("已过期",3);
	public String name;
    private Integer value;
    
    public static String getKey(Integer value) {
        for (IntegralStateEnum p : IntegralStateEnum.values()) {
            if (p.getValue().equals(value)) {
                return p.name;
            }
        }
        return null;
    }
}
